#!/bin/bash

# 启动后端
echo "启动后端服务..."
cd back-end-design
./mvnw spring-boot:run &
BACKEND_PID=$!
cd ..

# 启动前端
echo "启动前端服务..."
cd front-end-design
npm install
npm run dev &
FRONTEND_PID=$!
cd ..

echo "前后端已启动！"
echo "前端:http://localhost:5173"
echo "后端:http://localhost:8080"

# 等待用户按 Ctrl+C 结束
trap "kill $BACKEND_PID $FRONTEND_PID" EXIT
wait
